﻿@using Moonglade.Core

<footer id="moonglade-footer" class="bg-moonglade-accent2">
    <div class="container">
        <div class="row">
            <div class="col-md-3 col-sm-3">
                <h4 class="d-none d-sm-block">Copyright</h4>
                <div class="mb-3">
                    @Html.Raw(Utils.FormatCopyright2Html(BlogConfig.GeneralSettings.Copyright))
                </div>
                <small>
                    <a href="https://moonglade.blog" target="_blank">Moonglade</a> @Utils.AppVersion / .NET Core @Environment.Version
                    <br />
                    Developed by <a href="https://edi.wang" target="_blank">Edi Wang</a>
                </small>
            </div>

            <div class="col-md-3 col-sm-3 d-none d-sm-block">
                <h4>Subscription</h4>

                <a class="btn btn-sm btn-round btn-outline-footer" href="#" data-toggle="modal" data-target="#subscriptionmodal">
                    <span class="icon-rss"></span>
                    RSS / Atom
                </a>

                <a class="btn btn-sm btn-round btn-outline-footer footer-opml-link" href="~/opml" target="_blank">
                    <span class="icon-embed2"></span>
                    OPML
                </a>
            </div>

            @if (BlogConfig.FriendLinksSettings.ShowFriendLinksSection)
            {
                <div class="col-md-3 col-sm-3 d-none d-sm-block">
                    <h4>Friend Links</h4>
                    <cache expires-after="@TimeSpan.FromMinutes(60)">
                        @await Component.InvokeAsync("FriendLink")
                    </cache>
                </div>
            }

            <div class="col-md-3 col-sm-3">
                @Html.Raw(BlogConfig.GeneralSettings.FooterCustomizedHtmlPitch)
            </div>
        </div>
    </div>
</footer>

<div class="modal fade" id="subscriptionmodal" tabindex="-1" role="dialog" aria-labelledby="subscriptionmodalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h6 class="modal-title" id="subscriptionmodalLabel">RSS / Atom Feed</h6>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="row mb-4">
                    <div class="col-6">
                        <a asp-controller="Subscription" asp-action="rss" class="btn btn-block btn-outline-success">
                            Latest Posts (RSS)
                        </a>
                    </div>
                    <div class="col-6">
                        <a asp-controller="Subscription" asp-action="Atom" class="btn btn-block btn-outline-success">
                            Latest Posts (Atom)
                        </a>
                    </div>
                </div>
                <div class="row">
                    <cache expires-after="@TimeSpan.FromMinutes(60)">
                        @await Component.InvokeAsync("RssCatList")
                    </cache>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>